Tweak native-build.md example
authorKevin Ballard <kevin@sb.org>
Tue, 14 Oct 2014 21:30:17 +0000 (14:30 -0700)
committerKevin Ballard <kevin@sb.org>
Tue, 14 Oct 2014 21:30:17 +0000 (14:30 -0700)
`$(OUT_DIR)` may contain spaces, so it needs to be quoted. It also needs to be expanded by the shell, not by `make`, or any quotes/backslashes in the value will cause problems.

src/doc/native-build.md

index 60a169487eeb724178e1475bdcf4e9514778f117..ff77e4cad54b6268d82b3a02b004704a8d6c8a3b 100644 (file)
@@ -115,8 +115,8 @@ CFLAGS += -m64 -fPIC
 endif
 
 all:
-    $(CC) $(CFLAGS) hello.c -c -o $(OUT_DIR)/hello.o
-    $(AR) crus $(OUT_DIR)/libhello.a $(OUT_DIR)/hello.o
+    $(CC) $(CFLAGS) hello.c -c -o "$$OUT_DIR"/hello.o
+    $(AR) crus "$$OUT_DIR"/libhello.a "$$OUT_DIR"/hello.o
 
 ```